<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExampleTableTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('example_table', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->unsignedInteger('category_id')->default('0')->comment('分类ID');
            $table->unsignedTinyInteger('switch')->default('0')->comment('开关');
            $table->string('title', 50)->default('')->comment('标题');
            $table->unsignedInteger('cover_image')->default('0')->comment('封面图');
            $table->string('keywords', 500)->default('')->comment('关键词');
            $table->string('description', 200)->default('')->comment('描述');
            $table->text('content')->nullable()->comment('内容');
            $table->string('recommend_type', 50)->default('')->comment('推荐类型，复选框，数据字典');
            $table->timestamp('start_time')->nullable()->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
            $table->unsignedTinyInteger('type')->default('1')->comment('栏目类型，数据字典：1列表 2单页 3外链');
            $table->string('tree', 1000)->default('')->comment('分类树ID');
            $table->string('file_ids')->default('')->comment('附件ID集，英文逗号隔开');
            $table->unsignedInteger('province_id')->default('0')->comment('省份ID');
            $table->unsignedInteger('city_id')->default('0')->comment('城市ID');
            $table->unsignedInteger('county_id')->default('0')->comment('城市ID');
            $table->string('icon', 50)->default('')->comment('栏目图标');
            $table->string('href', 100)->default('')->comment('链接地址');
            $table->unsignedInteger('counts')->nullable()->default('0')->comment('计数器');
            $table->text('image_list')->nullable()->comment('图集列表，存储结构id+name+description+path+url');
            $table->string('image_list_ids')->default('')->comment('图集ID集');
            $table->unsignedTinyInteger('status')->default('1')->comment('发布状态');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('example_table');
    }
}
